const install = (vue, instance) => {
	const isToken = () => {
		if (!instance.$store.state.indexStore.token) {
			
			uni.showModal({
				title: '检测到您未登录,此页面需要用户身份而并非游客,是否去登录',
				confirmText: '我同意',
				cancelText: '让我考虑一下',
				success(status) {
					if (status.confirm) {
						uni.navigateTo({
							url: '../../pagesLogin/login/login'
						})
					}
				}
			})
			return false
		}
		return true
	}

	vue.prototype.tools = {
		isToken
	}
}

export default {
	install
}
